﻿#define _CRT_SECURE_NO_WARNINGS 1
#include<bits/stdc++.h>
using namespace std;
const int N = 1e5 + 10;
int a[N];
vector<int> L; //离散化数组

int getidx(int x) {
	return lower_bound(L.begin(), L.end(), x) - L.begin();
	//lower_bound 返回的是序列中第⼀个大于等于x的元素的位置
}

int main() {
	int n; cin >> n;
	for (int i = 1; i <= n; i++) cin >> a[i];

	//将元素存入L数组中
	for (int i = 1; i <= n; i++) L.push_back(a[i]);

	//排序去重
	sort(L.begin(), L.end());
	L.erase(unique(L.begin(), L.end()), L.end());
	//erase会指向第一个重复元素

	//打印离散化数组
	cout << "离散化数组为：";
	for (const auto& i : L) {
		cout << i << " ";
	}
	cout << '\n';

	int val; cin >> val;
	cout << getidx(val) << '\n';

	return 0;
}